Skip to content

Document upstream visibility enum + cascade for advanced/hidden flags#182

Merged
bdraco merged 6 commits into
mainfrom
docs/upstream-ui-hint-flags
May 11, 2026
Merged

Document upstream visibility enum + cascade for advanced/hidden flags#182
bdraco merged 6 commits into
mainfrom
docs/upstream-ui-hint-flags

Conversation

@bdraco
Copy link
Copy Markdown
Member

@bdraco bdraco commented May 6, 2026

What does this implement/fix?

Documentation pass on the ConfigEntry.advanced / ConfigEntry.hidden TypeScript types, calling out that the authoritative source for those flags is upstream ESPHome's new cv.Visibility schema kwarg (esphome/esphome#16267, merged into 2026.5.0b1); not the hand-curated heuristic in the catalog generator. Also notes the cascade pass added to the catalog generator (esphome/device-builder#350): a stricter parent forces every descendant at-least as strict, so a child's hidden=true may have arrived from an ancestor's Visibility.YAML_ONLY rather than from the field's own schema marker.

The upstream PR ships two real fields marked in 2026.5.0b1: setup_priority on every component (Visibility.YAML_ONLY); the time platform's update_interval (Visibility.ADVANCED). The frontend already filters entry.hidden correctly (isEntryVisible in src/util/config-validation.ts) and renders entry.advanced under the disclosure (config-entry-render-filter.ts), so no runtime change is needed; the next catalog sync against a schema bundle containing #16267 (https://schema.esphome.io still pins 2026.4.5 today) is what threads the new schema values onto those existing fields.

This PR exists so the frontend type docstrings explicitly point future maintainers at the upstream source. As upstream adoption of the new kwarg grows, the catalog's heuristic fallback shrinks; readers of the frontend code shouldn't have to trace through the catalog generator to figure out where entry.advanced was decided.

Related issue or feature (if applicable):

Types of changes

  • Bugfix (non-breaking change which fixes an issue) — bugfix
  • New feature (non-breaking change which adds functionality) — new-feature
  • Enhancement to an existing feature — enhancement
  • Breaking change (fix or feature that would cause existing functionality to not work as expected) — breaking-change
  • Refactor (no behaviour change) — refactor
  • Documentation only — docs
  • Maintenance / chore — maintenance
  • CI / workflow change — ci
  • Dependencies bump — dependencies

Checklist

  • The code change is tested and works locally.
  • npm run lint passes.
  • npm run test passes (1034/1034).
  • Tests have been added to verify that the new code works (where applicable).

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Documentation update to clarify the upstream (ESPHome) source-of-truth for the ConfigEntry.advanced and ConfigEntry.hidden flags, so future maintainers understand these values come from schema annotations rather than frontend-side heuristics.

Changes:

  • Expanded ConfigEntry.advanced JSDoc to point to ESPHome’s cv.Optional(..., advanced=True) annotation as the authoritative source.
  • Expanded ConfigEntry.hidden JSDoc to point to ESPHome’s cv.Optional(..., yaml_only=True) annotation and explain the intended UX behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/api/types.ts Outdated
Comment thread src/api/types.ts Outdated
Comment thread src/api/types.ts Outdated
@bdraco bdraco changed the title Document upstream esphome source for advanced/hidden flags Document upstream visibility enum + cascade for advanced/hidden flags May 6, 2026
@bdraco bdraco requested a review from Copilot May 6, 2026 03:58
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/api/types.ts Outdated
Comment thread src/api/types.ts Outdated
bdraco and others added 2 commits May 5, 2026 23:02
Multi-line backticked spans render poorly in TS-tooling hovers
(VS Code in particular). Shorten the references to bare
`Visibility.ADVANCED` / `Visibility.YAML_ONLY` so each inline-
code span sits on a single line.
@bdraco bdraco marked this pull request as ready for review May 11, 2026 16:25
Copilot AI review requested due to automatic review settings May 11, 2026 16:25
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.

Comment thread src/api/types.ts Outdated
Comment thread src/api/types.ts Outdated
Two follow-ups on the JSDoc Copilot flagged:

* Cascade references used a bare ``ADVANCED`` / ``YAML_ONLY``
  token after the first ``Visibility.ADVANCED`` /
  ``Visibility.YAML_ONLY`` mention. Bare tokens read as
  frontend-local concepts; qualified with the enum prefix they
  read as the upstream marker being cascaded. Switch both
  trailing references to the qualified form.
* ``upstream esphome's`` → ``upstream ESPHome's`` for
  capitalisation consistency with the rest of the file.

Drive-by: replace the inline em-dash in the ``hidden`` JSDoc
with a semicolon, matching the project's no-em-dash convention
in prose. No content change.
@bdraco bdraco merged commit c5a391e into main May 11, 2026
7 of 8 checks passed
@bdraco bdraco deleted the docs/upstream-ui-hint-flags branch May 11, 2026 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants